Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(sharing): enable unsharing for sharees for DAV shares #43117

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

miaulalala
Copy link
Contributor

@miaulalala miaulalala commented Jan 25, 2024

Allow unsharing for a sharee via "Unshare from me" in the calendar dialogue. AFAIK Contacts doesn't have an unshare from me button, maybe something for the frontend devs.

How to test

Scenario 1

  1. Create a group BobsGroup and adds Bob and Eric.
  2. User Alice creates a calendar "Workouts" and shares it with BobsGroup (with edit permission).
  3. Bob unshares the calendar "Workouts" from himself

Expected results:

  1. 2 rows in oc_dav_shares like this:
    image
  2. Bob cannot see "Workouts" any more
  3. Eric can still see workouts
  4. Alice can see the groupshare

Scenario 2

  1. Create a group BobsGroup and adds Bob and Eric.
  2. User Alice creates a calendar "Workouts" and shares it with BobsGroup (with edit permission).
  3. User Alice also shares the calendar "Workouts" with Bob directly:
    image
  4. Bob only sees one share and unshares the calendar "Workouts" from himself

Expected results:

  1. 2 rows in oc_dav_shares like this:
    image
  2. Bob cannot see "Workouts" any more
  3. Eric can still see workouts
  4. Alice can see the groupshare, but not the direct share

Ref #1653

@miaulalala miaulalala added this to the Nextcloud 29 milestone Jan 25, 2024
@miaulalala miaulalala self-assigned this Jan 25, 2024
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
@miaulalala miaulalala force-pushed the enh/1653/enable-unsharing-for-dav-shares branch from 3131714 to cd7f2f7 Compare January 30, 2024 17:36
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

apps/dav/lib/DAV/Sharing/SharingMapper.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingMapper.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingMapper.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingMapper.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/Command/CreateCalendar.php Fixed Show fixed Hide fixed
apps/dav/lib/Command/CreateCalendar.php Fixed Show fixed Hide fixed
apps/dav/appinfo/v1/carddav.php Dismissed Show dismissed Hide dismissed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/SharingService.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
apps/dav/lib/DAV/Sharing/Backend.php Fixed Show fixed Hide fixed
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works.

apps/dav/lib/DAV/Sharing/Backend.php Dismissed Show dismissed Hide dismissed
apps/dav/lib/DAV/Sharing/Backend.php Dismissed Show dismissed Hide dismissed
@miaulalala miaulalala marked this pull request as ready for review February 15, 2024 13:48
@miaulalala miaulalala requested review from a team, ArtificialOwl, icewind1991 and sorbaugh and removed request for a team February 15, 2024 13:48
@miaulalala miaulalala added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 15, 2024
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested & works

apps/dav/lib/CalDAV/CalDavBackend.php Outdated Show resolved Hide resolved
apps/dav/lib/CalDAV/Calendar.php Show resolved Hide resolved
apps/dav/lib/CalDAV/Sharing/Backend.php Outdated Show resolved Hide resolved
apps/dav/lib/CalDAV/Sharing/Service.php Outdated Show resolved Hide resolved
apps/dav/lib/CalDAV/Sharing/Service.php Outdated Show resolved Hide resolved
apps/dav/lib/CardDAV/Sharing/Backend.php Outdated Show resolved Hide resolved
apps/dav/lib/CardDAV/Sharing/Service.php Outdated Show resolved Hide resolved
apps/dav/lib/CardDAV/Sharing/Service.php Outdated Show resolved Hide resolved
…ks and calendars)

Signed-off-by: Anna Larch <anna@nextcloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews feature: dav
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants